<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-08-14 10:54:16
 * @LastEditTime: 2019-08-14 12:02:43
 * @LastEditors: Please set LastEditors
 -->
<template>
    <div class="lang">
        <van-button @click="ZH()" type="primary" size="mini" :plain="active == 1">中文</van-button>
        <van-button @click="EN()" type="primary" size="mini" :plain="active == 2">EN</van-button>
    </div>
</template>
<script>
import { Button } from 'vant';
export default {
    name:"Language",
    components:{
        [Button.name]:Button,
    },
    data(){
        return{
            active:2,
        }
    },
    methods:{
        EN(){
            this.$i18n.locale = 'en';
            this.$Local('en');
            this.active = 1;
        },
        ZH(){
            this.$i18n.locale = 'zhCH';
            this.$Local('zhCH');
            this.active = 2;
        },
    }
}
</script>
<style lang="less" scoped>
.lang{
    position: fixed;
    right:10px;
    top:0;
    z-index:1;
    height:50px;
    width:100px;
    display: flex;
    justify-content: center;
    align-items: center;
    button{
        margin: 0;
    }
}
</style>